package com.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.project.bean.GradeBean;
import com.project.bean.UserBean;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface IUserMapper extends BaseMapper<UserBean> {
    /**
     * 批量添加中间表记录
     * @param userId 用户ID
     * @param gradeIdArray 权限ID数组
     */
    void addCenter(@Param("userId") Integer userId,
                   @Param("gradeIdArray") Integer[] gradeIdArray);

    @Delete("delete from t_user_grade where fk_userId=#{id};" )
    public void delCenter(Integer userId);

    public List<GradeBean> findByUser(Integer userId);
}
